<template>
  <div class="new-tab-bar-content">
    <div id="title" :class="{ active: isActive }" @click="clickTab">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: "NewTabBarContent",
  props: {
    path: String,
  },
  methods: {
    clickTab() {
      this.$router.replace(this.path);
    },
  },
  computed: {
    isActive() {
      return this.$route.path.indexOf(this.path) != -1;
    },
  },
};
</script>

<style lang="less" scoped>
.active {
  color: #36924e;
  border-bottom: 1px solid #36924e;
}
</style>
